#pragma once

class Unicode
{
    private:

        static WCHAR aufstable[256];
        static UINT fscodepage;

        static void mbtwc(UINT cp, DWORD flags, LPCSTR src, int len, LPWSTR dst, int maxlen);

    public:

        static void unicode_init();
        static WCHAR* au(const char* s);
        static char* ua(const WCHAR* s);
        static WCHAR* au_fs(const char* s);
        static char* ua_fs(const WCHAR* s, int defchar);
        static void ua_copy(char* dst, int maxlen, const WCHAR* src);
        static void au_copy(WCHAR* dst, int maxlen, const char* src);
        static void ua_fs_copy(char* dst, int maxlen, const WCHAR* src, int defchar);
        static void au_fs_copy(WCHAR* dst, int maxlen, const char* src);
        static char* uutf8(const WCHAR* s);
        static WCHAR* utf8u(const char* s);
        static void to_lower(TCHAR* s, int len);
        static void to_upper(TCHAR* s, int len);

        static int same_aname(const WCHAR* an1, const WCHAR* an2);
};